﻿using FreshTexture.Model;
using System.Windows;

namespace FreshTexture.View
{
    /// <summary>
    /// Interaction logic for ProgressWindow.xaml
    /// </summary>
    public partial class ProgressWindow : Window
    {
        private readonly int maxSkippedFrame;
        private int acktualFrame;

        public ProgressWindow()
        {
            InitializeComponent();
        }

        public ProgressWindow(int frame)
        {
            maxSkippedFrame = frame;
            acktualFrame = 0;
            InitializeComponent();
        }

        private void BtnAbort(object sender, RoutedEventArgs e)
        {
            ZipIO.AbortButton(e);
        }

        public void UpdateProgressBarText(string textToShow)
        {
            if (acktualFrame <= maxSkippedFrame)
            {
                acktualFrame = 0;
                progresText.Text = textToShow;
            }
        }
    }
}